<template>
  <div class="com-container">
    <span class="title"> 报到实时信息 </span>
    <div class="com-dv" ref="studentRoll_ref">
      <dv-scroll-board :config="config" style="width: 100%; height: 100%" />
    </div>
  </div>
</template>

<script>

export default {
  props: ['admissionyear','academy','status'],
  watch: {
    admissionyear: {
      handler(newValue,oldValue) {
        this.getData()
      }
    },
    status: {
      handler(newValue,oldValue) {
        this.getData()
      }
    },
    academy: {
      handler(newValue,oldValue) {
        this.getData()
      }
    },
  },
  data() {
    return {
      allData:[],
      temp:[],
      config: {
        header: ['姓名','专业','报到时间'],
        data: [],
        columnWidth: [70],
        align: ["center", "center", "center"],
        headerBGC: '#1e5670',
      },

    };
  },
  mounted() {
    this.getData()
  },
  destroyed() {
  },

  methods: {
    getData() {
      this.request.get("/stuScreen/stuAdmissionData",{
        params: {
          admissionyear: this.admissionyear,
          academy: this.academy
        }
      }).then(res=>{
        if(res.code==20041) {
          this.allData=res.data
        }
      }).finally(()=>{
        this.updateChart()
      })
    },
    updateChart(){
      this.config.data=this.allData
      this.config={...this.config}
    },
    screenAdapter(){},
  }

};
</script>
// 设置为scoped，仅在本页面生效
<style lang="less" scoped>
.com-dv {
  width: 98%;
  height: 88%;
  margin-top: 7%;
  margin-left: 1%;
  position: absolute;
}
.com-container {
  border-radius: 20px;
  background-color: #222733;
}
.title {
  position: absolute;
  margin-left: 2%;
}
</style>
